﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Info
{
    /// <summary>
    /// 应用信息
    /// </summary>
    public static class AppInfo
    {
        /// <summary>
        /// 应用标题
        /// </summary>
        public static string AppTitle = BuildConstant.ProductTitle;

        /// <summary>
        /// 版本号
        /// </summary>
        public static Version Version => new Version(BuildConstant.BuildAssemblyVersion);

        /// <summary>
        /// 根目录 - \{Root}\
        /// </summary>
        public static string RootDirectory { get; private set; }

        /// <summary>
        /// 日志目录 - \{Root}\Logs\
        /// </summary>
        public static string LogDirectory { get; private set; }

        /// <summary>
        /// 缓存目录 - \{Root}\Cache\
        /// </summary>
        public static string CacheDirectory { get; private set; }

        /// <summary>
        /// 配置文件目录 - \{Root}\Config\
        /// </summary>
        public static string ConfigDirectory { get;private set; }


        /// <summary>
        /// 语言资源文件目录
        /// </summary>
        public static string LanguageDirectory { get; private set; }

        /// <summary>
        /// 数据文件目录 - \{Root}\Db\
        /// </summary>
        public static string DatabaseDirectory { get; private set; }

        /// <summary>
        /// 本地存储目录 - \{Root}\LocalStorage\
        /// </summary>
        public static string LocalStorageDirectory { get; private set; }

        static AppInfo()
        {
            // 1.初始化根路径
            RootDirectory = AppDomain.CurrentDomain.BaseDirectory;
            LogDirectory = Path.Combine(RootDirectory, "Logs");
            CacheDirectory = Path.Combine(RootDirectory, "Cache");
            ConfigDirectory = Path.Combine(RootDirectory, "Config");
            DatabaseDirectory = Path.Combine(RootDirectory, "Db");
            LanguageDirectory = Path.Combine(RootDirectory, "Languages");
            LocalStorageDirectory = Path.Combine(RootDirectory, "LocalStorage");
        }
    }
}
